package com.zeny.express.job.mdm;

import org.apache.commons.lang.math.RandomUtils;
import org.quartz.InterruptableJob;
import org.quartz.JobExecutionContext;
import org.quartz.UnableToInterruptJobException;

import com.zeny.express.framework.scheduler.quartz.BaseThreadJob;

public class CronExampleJob extends BaseThreadJob implements InterruptableJob {

	@Override
	protected void executeJob(JobExecutionContext context, int threadCount,
			int threadNo) throws Exception {
		
		LOGGER.info("threadCount : {}, threadNo : {}", threadCount, threadNo);
		
		context.getJobDetail().getJobDataMap().put(DATA_PARAM, RandomUtils.nextInt());
		
		Thread.sleep(20000);
	}

	@Override
	public void interrupt() throws UnableToInterruptJobException {
		LOGGER.info("TERMINATE ###############");
	}

}
